package filedemo;

public class FileGet {
    public static void main(String[] args) {
        try {
            java.io.BufferedWriter out = new java.io.BufferedWriter(new java.io.FileWriter("runoob.txt"));
            out.write("菜鸟教程");
            out.append("dasd");
            out.newLine();
            out.write("你好");
            out.flush();
            out.close();
            System.out.println("文件创建成功！");
            java.io.BufferedReader in = new java.io.BufferedReader(new java.io.FileReader("runoob.txt"));
            StringBuffer sb;
            while (in.ready()) {
                sb = (new StringBuffer(in.readLine()));
                System.out.println(sb);
            }
            in.close();
        } catch (java.io.IOException e) {
            throw new RuntimeException(e);
        }
    }
}
